import java.util.Scanner;

public class UserInterface {
	VendingMachine vend;
	
	public UserInterface () {
	    vend = new VendingMachine ();
	}
	public void enterItemID (String id, int quantity){
	    for (int i = 0; i < quantity; i++) {
	        // Add the item of this ID a number of times.
	        vend.addItem (id);
	    }
	}
	public void selectPayType () {
	    vend.createSale ();
        System.out.println ("Enter Credit Card: ");
        Scanner input = new Scanner (System.in);
        // The credit card is not necessarily a string,
        // but it will be represented by one for this case.
        vend.setupPayment (input.next ());
	}
	public void confirmIdentity () {
        System.out.println ("Enter PIN: ");
        Scanner input = new Scanner (System.in);
        vend.attemptPIN (input.next ());
	}
	public void completeSelection () {
		vend.endSelection ();
	}
}
